Skip to content

Conversation

SDartayet
Copy link
Contributor

@SDartayet SDartayet commented Oct 2, 2025

Motivation

Keeping track of removing clones in our codebase, and removing them where possible.

Description

This PR goes over all the clones in the blockchain crate, removing them where possible and justifying the necessary ones. Additionally, for the ones that could potentially be removed but doing so involves some larger refactors, a todo-clone comment is added

Part of #4668

@github-actions github-actions bot added the L1 Ethereum client label Oct 2, 2025
Copy link

github-actions bot commented Oct 2, 2025

Lines of code report

Total lines added: 0
Total lines removed: 11
Total lines changed: 11

Detailed view
+-----------------------------------------+-------+------+
| File                                    | Lines | Diff |
+-----------------------------------------+-------+------+
| ethrex/crates/blockchain/blockchain.rs  | 883   | -4   |
+-----------------------------------------+-------+------+
| ethrex/crates/blockchain/fork_choice.rs | 128   | -1   |
+-----------------------------------------+-------+------+
| ethrex/crates/blockchain/payload.rs     | 659   | -1   |
+-----------------------------------------+-------+------+
| ethrex/crates/blockchain/smoke_test.rs  | 236   | -5   |
+-----------------------------------------+-------+------+

@SDartayet SDartayet force-pushed the remove-blockchain-clones branch from 843732f to 9dd801d Compare October 13, 2025 15:01
@SDartayet SDartayet marked this pull request as ready for review October 14, 2025 18:41
@SDartayet SDartayet requested a review from a team as a code owner October 14, 2025 18:41
Copy link
Contributor

@JereSalo JereSalo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed it and everything seems to be okay.
For me some of the comments feel kind of unnecessary and the removed clones don't seem to be important either, I think we should've approached this differently, first measuring impact and then acting upon that. But if another reviewer thinks we should merge it I'm okay with it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L1 Ethereum client

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants